cmake_minimum_required(VERSION 3.15)

set(TARGET_NAME "ToolsExt_cu")
set(LIB_NAME "lib${TARGET_NAME}.so")
project(${TARGET_NAME})

set(MACA_INC_PATH "${MACA_PATH}/include")
set(MCTX_INC_PATH "${MACA_PATH}/include/mctx")
set(MCR_INC_PATH "${MACA_PATH}/include/mcr")

set(PRJ_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/../../../include/bridge/tools_ext")
set(CUPRJ_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/../../../include/")
message(STATUS "CUPRJ_INCLUDE: ${CUPRJ_INCLUDE}")

set(TOOLSEXT_WRAPPER_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/nvtx_wrapper.cpp)
link_directories( ${MACA_PATH}/lib )
add_library(${TARGET_NAME} SHARED ${TOOLSEXT_WRAPPER_SRC})

target_link_libraries( ${TARGET_NAME} PRIVATE mcToolsExt)
target_include_directories(${TARGET_NAME}
    PRIVATE
        ${MACA_INC_PATH}
        ${MCTX_INC_PATH}
        ${MCR_INC_PATH}
        ${CUPRJ_INCLUDE}
    PUBLIC
        ${PRJ_INCLUDE})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME} DESTINATION ${LIB_DEST_DIR})